package com.zonta.finance.domain.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 凭证字配置
 * </p>
 *
 * @author zonta
 * @since 2024-07-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("voucher_word_config")
@ApiModel(value="VoucherWordConfig对象", description="凭证字配置")
public class VoucherWordConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "凭证字")
    private String voucherWord;

    @ApiModelProperty(value = "打印标题")
    private String printTitle;

    @ApiModelProperty(value = "是否是默认[0:否，1：默认]")
    private Boolean defaultFlag;

    @ApiModelProperty(value = "租户id")
    private Long tenantId;

    @ApiModelProperty(value = "是否禁用")
    private Boolean disable;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "用户id")
    private Long memberId;

    @ApiModelProperty(value = "修改用户id")
    private Long updateMemberId;

    @ApiModelProperty(value = "是否删除，0：删除，1：未删除")
    private Boolean delFlag;

    @ApiModelProperty(value = "使用计数")
    private Integer useCount;

    public void initDefault() {
        if (this.getVoucherWord() == null) {
            this.setVoucherWord("");
        }
        if (this.getPrintTitle() == null) {
            this.setPrintTitle("");
        }
        if (this.getDefaultFlag() == null) {
            this.setDefaultFlag(false);
        }
        if (this.getTenantId() == null) {
            this.setTenantId(0L);
        }
        if (this.getDisable() == null) {
            this.setDisable(false);
        }
        if (this.getCreateTime() == null) {
            this.setCreateTime(new Date());
        }
        if (this.getUpdateTime() == null) {
            this.setUpdateTime(new Date());
        }
        if (this.getMemberId() == null) {
            this.setMemberId(0L);
        }
        if (this.getUpdateMemberId() == null) {
            this.setUpdateMemberId(0L);
        }
        if (this.getDelFlag() == null) {
            this.setDelFlag(false);
        }
        if (this.getUseCount() == null) {
            this.setUseCount(0);
        }
    }
}
